#{extends 'main_with_map.html' /}
#{set title:'Search results' /}

<div class="searchCriteria">
	<h3>Showing offers for <a href="@{Events.show(event.id)}"><span class="highlighted">${event.name}</span></a> in ${event.city} on ${event.startDate.format('dd MMMM yyyy')}</h3>
	<span>
		#{if (toPrice != null && toPrice != 0) || (fromPrice != null && fromPrice != 0)}
				Price 
				#{if fromPrice != null && fromPrice != 0}
					from ${fromPrice.formatCurrency('EUR')} 
				#{/if}
				#{if toPrice != null && toPrice != 0}
					to ${toPrice.formatCurrency('EUR')}
				#{/if}
		#{/if}
		#{if includePrivateOffers != null}
				#{if includePrivateOffers == true}
					including Private Offers
				#{/if}
				#{else}
					excluding Private Offers
				#{/else}
		#{/if}
	</span>
	<br>
	<strong>Description: </strong>${event.description}
</div>
#{if offerList.size() == 0 && premiumOfferList.size() == 0}
	<p>
		No offers match your desired criteria
	</p>
#{/if}
#{else}
	<div class="offersSection">
		#{list items:premiumOfferList, as:'offer'}
			<div class="singleOffer premium">
				#{if offer.commercial}
					 <b>${offer.user.hotelname}</b>
				#{/if}
				#{else}
					<b>Private</b>
				#{/else}
				<br>
				<span>Location: ${offer.city}&nbsp;&nbsp;|&nbsp;&nbsp;Size/Persons: ${offer.size}&nbsp;&nbsp;|&nbsp;&nbsp; 
					#{if offer.endDate == offer.startDate}
						on ${offer.startDate.format('dd MMMM yyyy')}
					#{/if}
					#{else}
						${offer.startDate.format('dd MMMM')}&nbsp;–&nbsp;${offer.endDate.format('dd MMMM yyyy')} 
					#{/else}</span>
				<div class="price">${offer.price.formatCurrency('EUR')}</div>
				<br>
				<a class="showOfferDetails" href="@{Offers.show(offer.id)}"> &nbsp;Details & Contact&nbsp;</a>
			</div>
		#{/list}
		#{list items:offerList, as:'offer'}
			<div class="singleOffer">
				#{if offer.commercial}
					 <b>${offer.user.hotelname}</b>
				#{/if}
				#{else}
					<b>Private</b>
				#{/else}
				<br>
				<span>Location: ${offer.city}&nbsp;&nbsp;|&nbsp;&nbsp;Size/Persons: ${offer.size}&nbsp;&nbsp;|&nbsp;&nbsp; 
					#{if offer.endDate == offer.startDate}
						on ${offer.startDate.format('dd MMMM yyyy')}
					#{/if}
					#{else}
						${offer.startDate.format('dd MMMM')}&nbsp;–&nbsp;${offer.endDate.format('dd MMMM yyyy')} 
					#{/else}</span>
				<div class="price">${offer.price.formatCurrency('EUR')}</div>
				<br>
				<a class="showOfferDetails" href="@{Offers.show(offer.id)}"> &nbsp;Details & Contact&nbsp;</a>
			</div>
		#{/list}
	</div>	
	<div id="map_canvas"></div>
#{/else}
